extends Item
var sum = ["cex___Hide_pet1","cex___Hide_pet2","cex___Hide_pet3","cex___Hide_skull1","cex___Hide_skull2","cex___Hide_totem1","cex___Hide_totem2","cex___Hide_totem3","cex___Hide_tree1","cex___Hide_tree2","cex___Hide_tree3","cex___Hide_tree4","cex___Hide_tree5"]

func init():
	type = config.EQUITYPE_EQUI
	attInit()
	att.atk = 40
	att.maxHp = 200
	name = "[color=yellow]先锋号角[/color]"
	info = "[color=yellow]<召唤神器>\n[/color][color=red]开局召唤一个随机召唤物[除魔法龙]\n杀死敌人[除召唤物和死灵]召唤一个随机召唤物[除魔法龙][/color]"

func _connect():
	masCha.connect("onBattleStart",self,"run1")
	masCha.connect("onKillChara",self,"run")
	#.run(atkinfo)
func run1():
	var cha = masCha.newChara(sys.rndListItem(sum),masCha.cell)
	if cha:
		cha.attInfo.maxHp += masCha.att.maxHp * 0.2
func run(atkinfo):
	yield(sys.get_tree().create_timer(0.02),"timeout")
	if !atkinfo.hitCha.isSumm && !atkinfo.hitCha.get("ischange") && atkinfo.hitCha.isDeath:
		var cha = masCha.newChara(sys.rndListItem(sum),atkinfo.hitCha.cell)
		if cha:
			cha.attInfo.maxHp += masCha.att.maxHp * 0.2
			cha.attInfo.spd += masCha.att.spd * 0.2
